﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Web.UI.DataVisualization.Charting"%>
<%@ Import Namespace="C3.Proto.Core.Model"%>
<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Project Report - <%=ViewData["Project"] %></h2>
        <a href="/Home">Back</a> <br />
        <a href="/Home/ProjectExcel">Export to Excel</a>
        <br />
<% var Chart1 = new System.Web.UI.DataVisualization.Charting.Chart
                      {
                          Width = 750,
                          Height = 296,
                          RenderType = RenderType.ImageTag,
                          ImageLocation = "..\\..\\TempImages\\ChartPic_#SEQ(200,30)",
                          Palette = ChartColorPalette.BrightPastel
                      };

   var t = new Title("Statewide Deficiency Category", Docking.Top, new System.Drawing.Font("Trebuchet MS", 9, System.Drawing.FontStyle.Bold), System.Drawing.Color.FromArgb(26, 59, 105));
    Chart1.Titles.Add(t);
    Chart1.ChartAreas.Add("ChartArea1");

    // Enable X axis labels automatic fitting
    Chart1.ChartAreas["ChartArea1"].AxisX.IsLabelAutoFit = true;
    Chart1.ChartAreas["ChartArea1"].AxisX.TextOrientation = TextOrientation.Rotated90;
    // Set X axis automatic fitting style
    Chart1.ChartAreas["ChartArea1"].AxisX.LabelAutoFitStyle =
        LabelAutoFitStyles.DecreaseFont | LabelAutoFitStyles.IncreaseFont | LabelAutoFitStyles.WordWrap;
    // create a couple of series
    Chart1.Series.Add("GC");
    Chart1.Series.Add("OFPC");
    Chart1.Series.Add("ROCIP");

    var months = (IList<string>)ViewData["Months"];
    Chart1.ChartAreas["ChartArea1"].AxisX.IntervalAutoMode = IntervalAutoMode.FixedCount;
    Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1;
    Chart1.Series[0].ChartType = SeriesChartType.Line;
    Chart1.Series[1].ChartType = SeriesChartType.Line;
    Chart1.Series[2].ChartType = SeriesChartType.Line;



    for (var i = 0; i < ((ProjectResults)ViewData["ProjectResults"]).GCB.Count; i++)
    {


        Chart1.Series["GC"].Points.AddY(((ProjectResults)ViewData["ProjectResults"]).GCB[i].Total);
       
        Chart1.Series["GC"].IsValueShownAsLabel = false;

        Chart1.Series["OFPC"].Points.AddY(((ProjectResults)ViewData["ProjectResults"]).OFPCB[i].Total);
        Chart1.Series["OFPC"].Points[i].AxisLabel = ((ProjectResults)ViewData["ProjectResults"]).GCB[i].Name;
        Chart1.Series["OFPC"].Points[i].LabelAngle = 30;
        
        
        Chart1.Series["OFPC"].IsValueShownAsLabel = false;
        
        Chart1.Series["ROCIP"].Points.AddY(((ProjectResults)ViewData["ProjectResults"]).ROCIPB[i].Total);
        Chart1.Series["ROCIP"].IsValueShownAsLabel = false;
    }
    
      
    Chart1.BorderSkin.SkinStyle = BorderSkinStyle.None;
    Chart1.BorderWidth = 0;
    
    Chart1.Legends.Add("Legend1");
    
        // show legend based on check box value
    Chart1.Legends["Legend1"].Enabled = true;

    // Render chart control
    Chart1.Page = this;
    var writer = new HtmlTextWriter(Page.Response.Output);
    Chart1.RenderControl(writer);

 %>

    <table cellpadding="5" cellspacing="5" style="border-collapse:collapse" border="1">
        <tr>
        <%
        foreach (var m in (List<string>)ViewData["Months"])
        { %>
        
             <td><%=m %></td>
        <%} %>
        </tr>
        <tr>
            <td colspan="<%=((List<string>)ViewData["Months"]).Count %>">
                2. Number of OFPC inspections conducted during Month					

            </td>
        </tr>
        <tr>
           
        
    <%
        foreach (var m in (List<MonthlyTotal>)((ProjectResults)ViewData["ProjectResults"]).OFPC)
        { %>
        
             <td><%=m.Total %>
            </td>
        <%} %>
        </tr>
        <tr>
            <td colspan="<%=((List<string>)ViewData["Months"]).Count %>">
                3. Number of GC inspections conducted during Month					

            </td>
        </tr>
        <tr>
           
        
    <%
        foreach (var m in (List<MonthlyTotal>)((ProjectResults)ViewData["ProjectResults"]).GC)
        { %>
        
             <td><%=m.Total %>
            </td>
        <%} %>
        </tr>
        
        <tr>
            <td colspan="<%=((List<string>)ViewData["Months"]).Count %>">
                4. STEP Recognition Eligibility				

            </td>
        </tr>
        <tr>
           
        
           
    <%
        foreach (var m in (IList<Step>)((ProjectResults)ViewData["ProjectResults"]).Steps)
        { %>
        
             <td><%=m.Value %>
            </td>
        <%} %>
        </tr>
        <tr>
            <td colspan="<%=((List<string>)ViewData["Months"]).Count %>">
                5. ROCIP General Liability, Workers, Compensations, Claims, Info, Amounts & Numbers			

            </td>
        </tr>
        <tr>
           
        
    <%
        foreach (var m in ((ProjectResults)ViewData["ProjectResults"]).Claims)
        { %>
        
             <td><%=m.Amount %>
            </td>
        <%} %>
        </tr>
        <tr>
           
        
    <%
       foreach (var m in ((ProjectResults)ViewData["ProjectResults"]).Claims)
        { %>
        
             <td><%=m.Count %>
            </td>
        <%} %>
        </tr>
    </table>
<h4>    SafetyNet Deficient Conditions	</h4>
    <table cellpadding="5" cellspacing="5" style="border-collapse:collapse" border="1">
        <tr>
            <td></td>
            <td>ROCIP</td>
            <td>OFPC</td>
            <td>GC</td>

        </tr>
       <tr>
            
            <td>A</td>
            
            <td><%=((ProjectResults)ViewData["ProjectResults"]).ROCIPSeverityA%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).OFPCSeverityA%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).GCSeverityA%></td>
       </tr>
        <tr>
            
            <td>B</td>
            
            <td><%=((ProjectResults)ViewData["ProjectResults"]).ROCIPSeverityB%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).OFPCSeverityB%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).GCSeverityB%></td>
       </tr>
        <tr>
            
            <td>C</td>
            
            <td><%=((ProjectResults)ViewData["ProjectResults"]).ROCIPSeverityC%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).OFPCSeverityC%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).GCSeverityC%></td>
       </tr>
        <tr>
            
            <td>D</td>
            
            <td><%=((ProjectResults)ViewData["ProjectResults"]).ROCIPSeverityD%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).OFPCSeverityD%></td>
            <td><%=((ProjectResults)ViewData["ProjectResults"]).GCSeverityD%></td>
       </tr>
    </table>
</asp:Content>
